package com.s64.ch07.controller;

import com.s64.ch07.entity.SysUser;
import com.s64.ch07.service.IScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

@RestController
@RequestMapping("/scores")
@CrossOrigin
public class ScoreController {
    @Autowired
    private IScoreService scoreService;

    @GetMapping
    public Set<SysUser> list(int range) {
        return scoreService.list(range - 1);
    }


}
